package io;

import io.command.*;
import card.Cardset;

/**
 * A Command Factory for IO to product different commands
 * 
 * 
 * @version 1.2.0
 */
public class IOCommandFactory {

	private IIO io;

	public IOCommandFactory(IIO io) {
		this.io = io;
	}

	/**
	 * 
	 * @param c
	 * @return cardInputCommand
	 */
	public IOCommand createCardInputCommand(Cardset c) {
		return new CardInputCommand(io, c);
	}

	/**
	 * 
	 * @param c
	 * @param playerName
	 * @return HandDisplayCommand
	 */
	public IOCommand createHandDisplayCommand(Cardset c, String playerName) {
		return new HandDisplayCommand(io, c, playerName);
	}

	/**
	 * 
	 * @return EndGameMessageCommand
	 */
	public IOCommand createEndGameMessageCommand() {
		return new EndGameMessageCommand(io);
	}

	/**
	 * 
	 * @param newRoundStarterName
	 * @return NewRoundMessageCommand
	 */
	public IOCommand createNewRoundMessageCommand(String newRoundStarterName) {
		return new NewRoundMessageCommand(io, newRoundStarterName);
	}

	/**
	 * 
	 * @param play
	 * @return ConfirmPlayCommand
	 */
	public IOCommand createConfirmPlayCommand(Cardset play) {
		return new ConfirmPlayCommand(io, play);
	}

	/**
	 * 
	 * @return NotBiggerPlayMessageCommand
	 */
	public IOCommand createNotBiggerPlayMessageCommand() {
		return new NotBiggerPlayMessageCommand(io);
	}

	/**
	 * 
	 * @param winner
	 * @return ContinueGameCommand
	 */
	public IOCommand createContinueGameCommand(String winner) {
		return new ContinueGameCommand(io, winner);
	}

	/**
	 * 
	 * @return EndApplicationMessageCommand
	 */
	public IOCommand createEndApplicationMessageCommand() {
		return new EndApplicationMessageCommand(io);
	}

	/**
	 * 
	 * @param playerName
	 * @param hand
	 * @return PlayerLandlordRatingCommand
	 */
	public IOCommand createPlayerLandlordRatingCommand(String playerName,
			Cardset hand) {
		return new PlayerLandlordRatingCommand(io, playerName, hand);
	}
}
